1. Field of the Invention
The present invention relates to a nonvolatile storage device, a control method of the nonvolatile storage device, and an information recording medium in which the nonvolatile storage device is realized, and more particularly to a nonvolatile storage device in which data can be written through the conversion of logical addresses to physical addresses and in which management information of the data can be recovered when data writing is interrupted, a control method for the nonvolatile storage device, and an information recording medium in which a program for controlling the nonvolatile storage device is recorded.
Further, the present invention relates to memory cards such as ATA (AT Attachment) cards, SSFDC (Solid State Floppy Disk Card Forum) cards, etc. in which data storage locations can be designated in the same way as in hard disks and floppy disks, a control method for the memory cards, and an information recording medium in which a program for controlling the memory cards is recorded.
Further, the present invention relates to a nonvolatile storage device which is provided with a flash EEPROM (Electrically Erasable Programmable Read Only Memory) and a RAM (Random Access Memory), in which a translation table for translating logical addresses designated as requested to read and write data into physical addresses in the flash EEPROM is divided and stored in the flash EEPROM and the RAM, and in which the translation table is prepared in the RAM based on the data of the translation table stored in the flash EEPROM, a control method for the nonvolatile storage device, and an information recording medium in which a program for controlling the nonvolatile storage device is recorded.
2. Description of the Related Art
Memory cards such as ATA cards, SSFDC cards, etc., as nonvolatile storage devices, are becoming wide spread as external storage devices of computers, and standardization of their specifications is in progress.
In particular, memory cards according to the PC (Personal Computer) card standard or the PCMCIA (Personal Computer Memory Card International Association) standard operate as an external storage device when they are connected to their host computers, and when the memory cards are disconnected from their host computers, they can be moved and carried alone with the data stored therein. Even if their host computers are powered on, hot connection and disconnection are possible. Because of such advantages, memory cards such as ATA cards, etc. are widely used as a means to record photograph data taken by digital cameras, etc. and to transfer the data to their host computers.
When memory cards such as ATA cards, SSFDC cards, etc. are requested to write and read data by their host computers to which the memory cards are connected, it is required to designate storage locations for the data. When the storage locations are designated, integers called logical addresses are used. Logical addresses are also used to designate storage locations when writing to and reading from hard disks and floppy disks are performed. Further, there are cases where the logical addresses are called logical block addresses.
For example, in accessing hard disks, as high-speed processing is possible when a certain amount of data such as 512 bytes of data are handled together, writing and reading are performed in units of a sector containing 512 bytes. Storage locations in actual hard disks are designated by a cylinder number, head number, sector number, etc., but in order to standardize the processing of reading and writing, the storage areas of hard disks are virtually arranged in a straight line and divided in sector units from the beginning, and they are numbered. These numbers mean logical addresses. In the case of floppy disks, logical addresses can be defined in the same way.
In host computers, logical addresses are used to access hard disks, etc., and therefore, when such a designating method of storage locations is made available to memory cards such as ATA cards, SSFDC cards, etc., it is useful in development of applications and data management. Therefore, in such memory cards, control is required so as to be able to designate storage locations using logical addresses.
Further, also when memory cards are connected to the above-mentioned digital cameras, logical addresses are used to designate storage locations in order that the digital cameras request the memory cards to write and read data. That is, the digital cameras operate as the above-mentioned host computer.
Now, such memory cards are realized because of nonvolatile storage devices, flash EEPROMs in particular, contained therein. The storage area of the flash EEPROMs is divided into one or a plurality of blocks, each block is divided into one or a plurality of pages, and each page is composed of a storage area in which the same capacity as a unit in writing and reading from hard disks, etc., for example, 512 bytes, can be stored. Further, a type in which an additional redundant area, for example, a storage area of 16 bytes, is added on each page is also widely used. The former has a capacity of 512 bytes in one page and the latter has a capacity of 528 bytes in one page, but it is common to both that the same 512 bytes of data, as a unit in reading and writing by host computers, can be stored.
Locations of the storage areas in flash EEPROMs can be uniquely identified by designating a chip number, block number in the chip, and page number in the block. Then, the storage areas in the flash EEPROMs are virtually arranged in a straight line and each page is sequentially numbered in units of pages from the beginning. These numbers are called physical addresses. That is, the locations in the storage areas in the flash EEPROMs can be designated by the physical addresses.
Flash EEPROMs are read-only memories which can be electrically erasable. That is, in principle, data can be written only once on electrically erased pages. Therefore, when it is required to change data stored on a certain page, firstly the page is erased and then new data are required to be written. Further, in flash EEPROMs, in order to decrease the number of elements and perform high-speed processing, the above-mentioned erasure is technically characterized in that it is carried out in units of block.
Further, some flash EEPROMs have a function of overwriting on their pages which already have data written thereon, on the redundant portions in particular. However, regarding such an overwriting function, the number of times of overwriting is limited in most cases. Further, there are also many flash EEPROMs which do not have the function of overwriting.
In such memory cards, by converting the logical addresses designated by their host computers into physical addresses, writing and reading from the pages located at the physical addresses are performed. However, because the writing is limited as described above, it is highly possible that the correspondence between the logical addresses and the physical addresses be frequently changed.
Up to now, a method of storing management information for making logical addresses correspond to physical addresses also in flash EEPROMs has been known. Further, in order to speed up reading and writing, a method which is provided for RAMs besides flash EEPROMs, in which an address translation table for translating logical addresses into physical addresses is stored, and in which when the correspondence between the logical addresses and the physical addresses is updated, the address translation table stored in the RAMs is also updated, has been proposed.
In such memory cards, memory cards according to the PC card standard in particular, hot unplugging is possible only when the writing process is not being performed, but there are cases where the memory cards are mistakenly pulled out by the user while the writing process is being performed. Further, when the memory cards are used as a storage device of digital cameras, etc., there are cases where power is turned off because of battery exhaustion during the writing process. In such cases, the demand for most appropriate adjustment of the management information for making logical addresses correspond to physical addresses and for the least amount of obstacles to the use of the memory cards is great.
In order to solve the above problems, it is an object of the present invention to provide a nonvolatile storage device in which data can be written through translation of logical addresses into physical addresses, and in which, when the operation of the data writing is interrupted, the management information of the data can be recovered, a control method for the nonvolatile storage device, and an information recording medium in which a program for controlling the nonvolatile storage device is recorded.
Further, it is an object of the present invention to provide memory cards such as ATA cards, SSFDC cards, etc. in which data storage locations can be designated in the same way as in hard disks and floppy disks, a control method for the memory cards, and an information recording medium in which a program for controlling the memory cards is recorded.
Further, it is an object of the present invention to provide a nonvolatile storage device which is provided with a flash EEPROM and a RAM, in which a translation table for translating logical addresses designated as requested to read and write data into physical addresses in the flash EEPROM is divided and stored in the flash EEPROM and the RAM, and in which the translation table is prepared in the RAM based on the translation table stored in the flash EEPROM, a control method for the nonvolatile storage device, and an information recording medium in which a program for controlling the nonvolatile storage device is recorded.
A first exemplary embodiment of this invention is a nonvolatile storage device, by including:
(a) a first storage device for storing data and management information that makes a logical address correspond to a physical address of the location of an area storing the data;
(b) a request receiving device for receiving a request for writing data at any location indicated by a logical address;
(c) an information obtaining device for obtaining the physical address corresponding to a logical address received by the request receiving device through the management information stored in the first storage device, and for obtaining first management information storing the management information to control the physical address when the location indicated by the first physical address is used and second management information storing the management information to control the second physical address of a location which is not yet used;
(d) an area obtaining device for obtaining, from the first storage device, an area which is not yet used as an area to store third management information and fourth management information;
(e) a second storage device for replacing the first physical address contained in the first management information obtained by the information obtaining device with the second physical address, and for storing management information made to correspond to the area storing the fourth management information obtained by the area obtaining device in the area storing the third management information obtained by the area obtaining device; and
(f) a third storage device for replacing the second physical address contained in the second management information obtained by the information obtaining device with the first physical address, and for storing the second physical address in the area storing the fourth management information obtained by the area obtaining device.
Moreover, xe2x80x9cusedxe2x80x9d indicates both cases, that is, the case where the area is presently in use and the case where the area was used in the past and only obsolete data are stored therein at present, and accordingly, the area means xe2x80x9cerasablexe2x80x9d in flash EEPROMs. Hereinafter, the same applies.
FIG. 1 is a block diagram showing the outline of the first exemplary embodiment of this invention. In a nonvolatile storage device 10 according to the first exemplary embodiment of this invention:
the first storage device 11 stores data and management information that makes a logical address correspond to a physical address of the location of an area storing the data;
the request receiving device 12 receives a request for writing data at any location indicated by a logical address;
the information obtaining devicexe2x80x94obtains the physical address corresponding to a logical address received by the request receiving device 12 through management information stored in the first storage device 11, and obtains first management information storing the management information to control the physical address when the location indicated by the first physical address is used and second management information storing the management information to control the second physical address of a location which is not yet used;
the area obtaining device 14 obtains, from the first storage device 11, an area which is not yet used as an area to store third management information and fourth management information;
the second storage device 15 replaces the first physical address contained in the first management information obtained by the information obtaining device 13 with the second physical address, and stores management information made to correspond to the area storing the fourth management information obtained by the area obtaining device in the area storing the third management information obtained by the area obtaining device 14; and
the third storage device 16 replaces the second physical address contained in the second management information obtained by the information obtaining device 13 with the first physical address, and stores the second physical address in the area storing the fourth management information obtained by the area obtaining device 14.
According to the first exemplary embodiment of this invention, a nonvolatile storage device in which data can be written through the translation of logical addresses into physical addresses can be provided.
Further, a memory card such as an ATA card, SSFDC card, etc. in which storage locations of data can be designated in the same way as in hard disks and floppy disks can be provided.
A second exemplary embodiment of this invention is the nonvolatile storage device of the first exemplary embodiment of this invention, further including:
(g) a writing determining device for determining whether the fourth management information to be stored by the third storage device is stored in the area storing the fourth management information made to correspond to the third management information stored by the third management information storage means; and
(h) information recovery device for replacing the second physical address contained in the second management information with the first physical address based on the first management information and the second management information to be stored in the first storage device when the writing determining device determined that no fourth management information is stored and for recovering the fourth management information by storing the second physical address in the area made to correspond to the third management information stored by the second storage device.
FIG. 2 shows a block diagram showing the outline of the second exemplary embodiment of this invention. Moreover, in FIG. 2, the elements having the same function as in FIG. 1 are given the same reference numerals.
In the second exemplary embodiment of this invention:
the writing determining device 17 determines whether the fourth management information to be stored by the third storage device is stored in the area storing the fourth management information made to correspond to the third management information stored by the second storage device 15; and
the information recovery device 18 replaces the second physical address contained in the second management information with the first physical address based on the first management information and the second management information to be stored in the first storage device 11 when the writing determining device 17 determined that no fourth management information is stored and recovers the fourth management information by storing the second physical address in the area made to correspond to the third management information stored by the second storage device.
According to the second invention, a nonvolatile storage device can be provided in which, when the operation of writing data through the translation of logical addresses into physical addresses is interrupted, the management information of the data can be recovered.
A third exemplary embodiment of this invention is the nonvolatile storage device of the first exemplary embodiment of this invention or second exempleary embodiment of this invention, wherein the first storage device consist device comprises a nonvolatile storage device or a combination of the nonvolatile storage device and a volatile storage device.
According to the third exemplary embodiment of this invention, a nonvolatile storage device which is provided with a flash EEPROM and a RAM can be provided, in which a translation table for translating logical addresses to be designated as requested to read and write data into physical address in the flash EEPROM is divided and stored in the flash EEPROM and the RAM, and in which the translation table is prepared in the RAM based on the translation table stored in the flash EEPROM.
A fourth exemplary embodiment of this invention is a control method for a nonvolatile storage device provided with a storage device storing data and management information to make a logical address correspond to a physical address of the location of an area storing the data, the control method being including:
(a) a request receiving step for receiving a request for writing data at any location shown by a logical address;
(b) a before-writing information obtaining step for obtaining a physical address corresponding to the logical address received in the request receiving step through management information stored in the storage device and for obtaining first management information storing the management information to control the physical address when the location shown by the first physical address is used and second management information storing the management information to control a second physical address of a location which is not yet used;
(c) a new-area obtaining step for obtaining, from the storage device, an area which is not yet used as an area to store third management information and fourth management information;
(d) a third management information storage step for replacing the first physical address contained in the first management information obtained in the before-writing information obtaining step with the second physical address and for storing management information made to correspond to the area storing the fourth management information obtained in the new-area obtaining step in the area storing the third management information obtained in the new area obtaining step; and
(e) a fourth management information storage step for replacing the second physical address contained in the second management information obtained by the before-writing information obtaining step with the first physical address and for storing the second physical address in the area storing the fourth management information obtained in the new-area obtaining step.
A fifth exemplary embodiment of this invention is a control method for the nonvolatile storage device as discussed a bove, further including:
(f) a writing determining step for determining whether the fourth management information to be stored in the fourth management information storage step is stored in the area to store the fourth management information made to correspond to the third management information stored in the third management information storage step; and
(g) a fourth management information recovery step for replacing the second physical address contained in the second management information with the first physical address based on the first management information and the second management information stored in the storage device when the writing determining step determined that no fourth management information is stored, and for recovering the fourth management information by storing the first physical address in the area made to correspond to the third management information stored in the third management information storage step.
By executing a method according to the fourth and fifth exemplary embodiment of this invention on a nonvolatile storage device, a nonvolatile storage device according to the first through third exemplary embodiment of this invention can be provided. By this, the same effect as in the first through third exemplary embodiment of this invention is produced.
A sixth exemplary embodiment of this invention is an information recording medium in which is recorded a program for controlling a nonvolatile storage device provided with a storage device storing data and management information to make a logical address correspond to a physical address of the location of an area storing the data, the program including:
(a) a request receiving step for receiving a request for writing data at any location shown by a logical address;
(b) a before-writing information obtaining step for obtaining a physical address corresponding to the logical address received in said request receiving step through the management information stored in the storage device and for obtaining first management information storing management information to control the physical address when the location shown by the first physical address is used and second management information storing management information to control the second physical address of a location which is not yet used;
(c) a new-area obtaining step for obtaining, from the storage device, an area which is not yet used as an area to store third management information and fourth management information;
(d) a third management information storage step for replacing the first physical address contained in the first management information obtained in the before-writing information obtaining step with the second physical address, and for storing management information made to correspond to the area storing the fourth management information obtained in the new-area obtaining step in the area storing the third management information obtained in the new area obtaining step; and
(e) a fourth management information storage step for replacing the second physical address contained in the second management information obtained in the before-writing information obtaining step with the first physical address, and for storing the first physical address in the area storing the fourth management information obtained in the new-area obtaining step.
A seventh exemplary embodiment of this invention is an information recording medium recording a program for controlling the nonvolatile storage device as discussed above, the program further including:
(f) a writing determining step for determining whether the fourth management information to be stored in the fourth management information storage step is stored in the area storing the fourth management information made to correspond to the third management information stored in the third management information storage step, and
(g) a fourth management information recovery step for replacing the second physical address contained in the second management information with the first physical address based on the first management information and the second management information stored in the storage device when the writing determining step determines that no fourth management information is stored and for recovering the fourth management information by storing the first physical address in the area made to correspond to the third management information stored in the third management information storage step.
According to the sixth and seventh exemplary embodiment of this invention, by using an information recording medium recording these programs, these programs become products to be easily distributed and sold separately from the nonvolatile storage devices. Further, when the programs recorded in an information recording medium of the present invention are executed on nonvolatile storage devices, a nonvolatile storage device according to the first through third exemplary embodiment of this invention, and a control method of a nonvolatile storage device according to the fourth or fifth examplary embodiment of this invention can be fulfilled, and the same result as in these exemplary embodiments can be obtained.